#ifndef FILETREE_H
#define FILETREE_H
#include "StompedReality/Core/FileSystem.h"
#include "StompedReality/Core/GameAccess.h"
#include <Gwen/Controls/TreeControl.h>
#include <Gwen/Gwen.h>
namespace StomperLib {
namespace Controls
{
class FileTree : public Gwen::Controls::TreeControl, public StompedReality::GameAccess {
 protected:

  StompedReality::Utility::FileFilter m_Filter;
  Gwen::String m_Path;
  Gwen::Controls::TreeNode* CreatePathNode( const Gwen::String path );
  void OnFileSelection( Gwen::Event::Info info );

 public:

  GWEN_CONTROL( FileTree, Gwen::Controls::TreeControl );

  Gwen::Controls::TreeNode* AddFile( const Gwen::String path, const Gwen::String file );
  Gwen::Controls::TreeNode* AddFile( StompedReality::Utility::FileInfo fileInfo );

  void Refresh( );
  void SetFilter( const StompedReality::Utility::FileFilter filter );
  void SetPath( const Gwen::String path );

  Gwen::Event::Caller onFileSelection;
  Gwen::Event::Caller onFileAdded;

  void NotifyNotSaved( std::string fileName );
  void NotifySaved( std::string fileName );
};

}
}
#endif // ifndef FILETREE_H
